-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Add intadd
function
#9742
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Add intadd
function
#9742
Conversation
Hello @adsr
is not desired, in your case ... is a must I would say. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me
@bwoebi Hello. I Am curious about your approval on the PR what Does it mean? This is just to know More about the process in PHP contribution. |
Z_PARAM_LONG(addend2) | ||
ZEND_PARSE_PARAMETERS_END(); | ||
|
||
RETURN_LONG(addend1 + addend2); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Signed integer overflow is undefined, this should be converted to unsigned (and back).
IMO, this needs at least discussion on the internals mailing list. Personally, I'm not in favor of this, unless we'd implement full support for all operators (e.g. multiplication). And even then, I almost never find overflow behavior reasonable, and would rather prefer an exception (or way better, bigint support). |
I agree with @cmb69 |
Let's see what people think on the list but that s a no for me, usually I appreciate new ideas, but I m not liking this one. |
Useful for when integer overflow is desired instead of becoming a float.
Synopsis:
Can write an RFC if desired.
(Requesting
hacktoberfest-accepted
label for Hacktoberfest cred.)